It is very easy to write incomplete assertions when using some test frameworks. This rule enforces complete assertions in the following cases:
Should() is not followed by an assertion invocation.
Check.That() is not followed by an assertion invocation. Received() is not followed by an invocation. In such cases, what is intended to be a test doesn’t actually verify anything.
string actual = "Hello World!"; // Fluent Assertions actual.Should(); // Noncompliant // NFluent Check.That(actual); // Noncompliant // NSubstitute command.Received(); // Noncompliant
string actual = "Hello World!";
// Fluent Assertions
actual.Should().Contain("Hello");
// NFluent
Check.That(actual).Contains("Hello");
// NSubstitute
command.Received().Execute();